// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Hello, World! (You will see this line every time server resources reload)')

// Mod 缩写
let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let CR = (id, x) => MOD("create", id, x)
let CRA = (id, x) => MOD("createaddition", id, x)
let TC = (id, x) => MOD("tconstruct", id, x)
let MC = (id, x) => MOD("minecraft", id, x)
let KJ = (id, x) => MOD("kubejs", id, x)
let FD = (id, x) => MOD("farmersdelight", id, x)
let BOP = (id, x) => MOD("biomesoplenty", id, x)
let SD = (id, x) => MOD("storagedrawers", id, x)
let SP = (id, x) => MOD("supplementaries", id, x)
let F = (id, x) => MOD("forge", id, x)
let OCC = (id, x) => MOD("occultism", id, x)
let MEK = (id, x) => MOD("mekanism", id, x)
let MEKG = (id, x) => MOD("mekanismgenerators", id, x)
let MEKT = (id, x) => MOD("mekanismtools", id, x)
let IF = (id, x) => MOD("industrialforegoing", id, x)
let TAC = (id, x) => MOD("tac", id, x)
let FAA = (id, x) => MOD("forbidden_arcanus", id, x)
let DC = (id, x) => MOD("druidcraft", id, x)
let IAF = (id, x) => MOD("iceandfire", id, x)
let TM = (id, x) => MOD("torchmaster", id, x)
let AR = (id, x) => MOD("doomangelring", id, x)
let TE = (id, x) => MOD("thermal", id, x)
let PW = (id, x) => MOD("powah", id, x)
let RS = (id, x) => MOD("refinedstorage", id, x)
let PZ = (id, x) => MOD("pipez", id, x)
let TLM = (id, x) => MOD("touhou_little_maid", id, x)
let CO = (id, x) => MOD("crossroads", id, x)
let UG = (id, x) => MOD("undergarden", id, x)
let VC = (id, x) => MOD("vanillacookbook", id, x)
//



onEvent('recipes', event => {
	
//钻石
event.custom({
  "type": "interactio:block_explode",
  "input": {
    "block": "coal_block"
  },
  "output": {
    "type": "item",
    "entries": [
      {
        "result": {
          "item": "diamond"
        },
        "weight": 0.16
      },
      {
        "result": {
          "item": "obsidian"
        },
        "weight": 0.44
      }
    ],
    "empty_weight": 0.40
  }
})	

//青铜、锡统一
   let ingots2 = ['bronze','tin']   
   let mod2 = 'mekanism'
     
for (let i of ingots2) {
         
event.replaceOutput({}, `#forge:ingots/${i}`, `${mod2}:ingot_${i}`)
         
event.replaceOutput({}, `#forge:nuggets/${i}`, `${mod2}:nugget_${i}`)
         
event.replaceOutput({}, `#forge:storage_blocks/${i}`, `${mod2}:block_${i}`)
    }
//女仆
event.custom({
  "type": "tconstruct:entity_melting",
  "entity": {
    "type": TLM('maid')
  },
  "result": {
    "fluid": "create:chocolate",
    "amount": 50
  },
  "damage": 2
})

//废料
	event.remove({id:MEK("radioactive_waste_barrel")})
	event.shaped(MEK('radioactive_waste_barrel'), [
		'TTT',
		'S S',
		'SLS'
	], {
		T: IF('dryrubber'),
		S: CR('shadow_steel'),
		L: {"tag":"forge:ingots/lead"}
	})
//Meka套装
    event.replaceInput({ id:MEK("mekasuit_helmet") }, MC("netherite_helmet"), MEKT('refined_obsidian_helmet'))
    event.replaceInput({ id:MEK("mekasuit_bodyarmor") }, MC("netherite_chestplate"), MEKT('refined_obsidian_chestplate'))
    event.replaceInput({ id:MEK("mekasuit_pants") }, MC("netherite_leggings"), MEKT('refined_obsidian_leggings'))
    event.replaceInput({ id:MEK("mekasuit_boots") }, MC("netherite_boots"), MEKT('refined_obsidian_boots'))	
//终极电路：修改
	event.remove({id:MEK("control_circuit/ultimate")})
	event.recipes.createSequencedAssembly([
		MEK('ultimate_control_circuit'),
	], MEK('elite_control_circuit'), [
		event.recipes.createDeploying(MEK('elite_control_circuit'), [MEK('elite_control_circuit'), MEK('alloy_atomic')]),
		event.recipes.createDeploying(MEK('elite_control_circuit'), [MEK('elite_control_circuit'), MEK('alloy_atomic')]),
		event.recipes.createFilling(MEK('elite_control_circuit'), [MEK('elite_control_circuit'), Fluid.of(TC("molten_ender"), 250)])
	]).transitionalItem(MEK('elite_control_circuit'))
		.loops(1)
		.id('mekanism:ultimate_control_circuit')
//
//富石英铁配方修改
event.remove({id:RS('quartz_enriched_iron')})
event.custom(
{
  "type": "create:mixing",
  "ingredients": [
    {
      "item": MC('iron_ingot')
    },
    {
      "item": MC('iron_ingot')
    },
    {
      "item": MC('iron_ingot')
    },
    {
      "item": MC('quartz')
    }
                 ],
  "results": [
    {
      "item": RS('quartz_enriched_iron'),
      "count": 4
    }
             ]
})	
	

//热力蒸馏方块配方修改
event.remove({id:MEK('thermal_evaporation/block')})
event.custom(
{
  "type": "create:mixing",
  "ingredients": [
    {
      "item": "mekanism:ingot_bronze"
    },
    {
      "item": "mekanism:ingot_bronze"
    },
    {
      "item": "mekanism:ingot_bronze"
    },
    {
      "item": "mekanism:ingot_bronze"
    },
	{
      "fluid": "tconstruct:molten_steel",
      "nbt": {},
      "amount": 144
    }
  ],
  "results": [
    {
      "item": MEK('thermal_evaporation_block'),
      "count": 5
    }
  ],
  "heatRequirement": "heated",
})



	
//移除原有冶金灌注机配方
event.remove({id:MEK('metallurgic_infuser')})
//添加新配方
event.shaped(MEK('metallurgic_infuser'), [
		'NON',
		'NJN',
		'NON'
	], {
		J: CR('brass_casing'),
		O: KJ('dendro_essence'),
		N: MC('iron_ingot')
	})




//钢质机壳配方修改
    event.remove({id:MEK('steel_casing')})
	event.recipes.createSequencedAssembly([
		MEK('steel_casing'),
	], IF('machine_frame_simple'), [
		event.recipes.createDeploying(IF('machine_frame_simple'), [IF('machine_frame_simple'), CR('electron_tube')]),
		event.recipes.createDeploying(IF('machine_frame_simple'), [IF('machine_frame_simple'), MEK('ingot_steel')]),
		event.recipes.createDeploying(IF('machine_frame_simple'), [IF('machine_frame_simple'), MEK('ingot_steel')])
	]).transitionalItem(CR('brass_casing'))
		.loops(1)
		.id('eow:steel_casing')

//风力发电机配方修改
    event.remove({id:MEKG("generator/wind")})
	event.shaped(MEKG('wind_generator'), [
		' A ',
		'OIO',
		'MXM'
	], {
		A: CR('propeller'),
		O: MEK('ingot_osmium'),
        M: MEK('energy_tablet'),
		I: IAF('dragonbone'),
		X: MEK('advanced_control_circuit')
	})
	
//修改原子分解机
	event.remove({id:MEK('atomic_disassembler')})
	event.shaped(MEK('atomic_disassembler'), [
		'NMN',
		'NIN',
		' X '
	], {
		N: MC('netherite_ingot'),
        M: MEK('energy_tablet'),
		I: MEK('alloy_atomic'),
		X: MEK('ingot_refined_obsidian')
	})

//基础通用线缆配方修改
    event.remove({id:MEK("transmitter/universal_cable/basic")})
	event.shaped(MEK('basic_universal_cable', 8), [
		' A ',
		'OIO',
		' A '
	], {
		A: CO('waste_salt'),
		O: MEK('ingot_steel'),
		I: PZ('energy_pipe')
	})
//基础加压管道配方修改
    event.remove({id:MEK("transmitter/pressurized_tube/basic")})
	event.shaped(MEK('basic_pressurized_tube', 8), [
		' A ',
		'OIO',
		' A '
	], {
		A: IF('dryrubber'),
		O: MEK('ingot_steel'),
		I: PZ('fluid_pipe')
	})
//基础机械管道配方修改
    event.remove({id:MEK("transmitter/mechanical_pipe/basic")})
	event.shaped(MEK('basic_mechanical_pipe', 8), [
		' A ',
		'OIO',
		' A '
	], {
		A: IF('dryrubber'),
		O: CO('fluid_injector'),
		I: CR('mechanical_pump')
	})
//基础热导线缆配方修改
    event.remove({id:MEK("transmitter/thermodynamic_conductor/basic")})
	event.shaped(MEK('basic_thermodynamic_conductor', 8), [
		'AAA',
		'OIO',
		'AAA'
	], {
		A: IF('dryrubber'),
		O: KJ('chaos_simulation'),
		I: CR('brass_sheet')
	})

//裂变堆外壳配方修改
event.remove({id:MEKG('fission_reactor/casing')})
event.custom(
{
  "type": "create:mixing",
  "ingredients": [
    {
      "tag": "forge:ingots/lead"
    },
    {
       "tag": "forge:ingots/lead"
    },
    {
       "tag": "forge:ingots/lead"
    },
    {
       "tag": "forge:ingots/lead"
    },
    {
      "item": MEK('steel_casing')
    },
	{
      "fluid": "kubejs:egg_fluid",
      "nbt": {},
      "amount": 1000
    }
  ],
  "results": [
    {
      "item": MEKG('fission_reactor_casing'),
      "count": 4
    }
  ],
  "heatRequirement": "heated",
})

//需要下界合金制作终极工厂安装器
    event.replaceInput({ id:MEK("tier_installer/ultimate") }, MC("diamond"), MC('netherite_ingot'))
//精英电路：修改
	event.remove({id:MEK("control_circuit/elite")})
	event.recipes.createSequencedAssembly([
		MEK('elite_control_circuit'),
	], MEK('advanced_control_circuit'), [
		event.recipes.createDeploying(MEK('advanced_control_circuit'), [MEK('advanced_control_circuit'), MEK('alloy_reinforced')]),
		event.recipes.createDeploying(MEK('advanced_control_circuit'), [MEK('advanced_control_circuit'), MEK('alloy_reinforced')]),
		event.recipes.createFilling(MEK('advanced_control_circuit'), [MEK('advanced_control_circuit'), Fluid.of(IF("meat"), 200)])
	]).transitionalItem(MEK('advanced_control_circuit'))
		.loops(1)
		.id('mekanism:elite_control_circuit')
//高级电路：修改
	event.remove({id:MEK("control_circuit/advanced")})
	event.recipes.createSequencedAssembly([
		MEK('advanced_control_circuit'),
	], MEK('basic_control_circuit'), [
		event.recipes.createDeploying(MEK('basic_control_circuit'), [MEK('basic_control_circuit'), MEK('alloy_infused')]),
		event.recipes.createDeploying(MEK('basic_control_circuit'), [MEK('basic_control_circuit'), MEK('alloy_infused')]),
		event.recipes.createFilling(MEK('basic_control_circuit'), [MEK('basic_control_circuit'), Fluid.of(TC("molten_glass"), 200)])
	]).transitionalItem(MEK('basic_control_circuit'))
		.loops(1)
		.id('mekanism:advanced_control_circuit')


//强化黑曜石套装变贵
	event.remove({id:MEKT("refined_obsidian/armor/helmet")})
	event.remove({id:MEKT("refined_obsidian/armor/chestplate")})
	event.remove({id:MEKT("refined_obsidian/armor/leggings")})
	event.remove({id:MEKT("refined_obsidian/armor/boots")})
	
		event.shaped(MEKT('refined_obsidian_helmet'), [
		' A ',
		'RNR',
		'B C'
	], {
		A: IAF('dragonsteel_fire_ingot'),
		B: IAF('dragonsteel_ice_ingot'),
		C: IAF('dragonsteel_lightning_ingot'),
		R: MEK('ingot_refined_obsidian'),
		N: MC('netherite_helmet')
	})
		event.shaped(MEKT('refined_obsidian_chestplate'), [
		' A ',
		'RNR',
		'B C'
	], {
		A: IAF('dragonsteel_fire_ingot'),
		B: IAF('dragonsteel_ice_ingot'),
		C: IAF('dragonsteel_lightning_ingot'),
		R: MEK('ingot_refined_obsidian'),
		N: MC('netherite_chestplate')
	})
		event.shaped(MEKT('refined_obsidian_leggings'), [
		' A ',
		'RNR',
		'B C'
	], {
		A: IAF('dragonsteel_fire_ingot'),
		B: IAF('dragonsteel_ice_ingot'),
		C: IAF('dragonsteel_lightning_ingot'),
		R: MEK('ingot_refined_obsidian'),
		N: MC('netherite_leggings')
	})
		event.shaped(MEKT('refined_obsidian_boots'), [
		' A ',
		'RNR',
		'B C'
	], {
		A: IAF('dragonsteel_fire_ingot'),
		B: IAF('dragonsteel_ice_ingot'),
		C: IAF('dragonsteel_lightning_ingot'),
		R: MEK('ingot_refined_obsidian'),
		N: MC('netherite_boots')
	})
	

//修改天使指环
    event.remove({id:AR("itemdoomangelring")})
	event.shaped(AR('itemdoomangelring'), [
		'NAN',
		'OIO',
		'SES'
	], {
		N: MC('netherite_ingot'),
		A: MEK('jetpack_armored'),
		O: IAF('ambrosia'),
		I: MC('elytra'),
		S: CO('ingot_copshowium'),
		E: TC('piglin_brute_head')
	})

//数采配方修改
    event.remove({id:MEK('digital_miner')})
	event.recipes.createSequencedAssembly([
		MEK('digital_miner'),
	], MEK('steel_casing'), [
		event.recipes.createDeploying(MEK('steel_casing'), [MEK('steel_casing'), CR('precision_mechanism')]),
		event.recipes.createDeploying(MEK('steel_casing'), [MEK('steel_casing'), MEK('alloy_atomic')]),
		event.recipes.createDeploying(MEK('steel_casing'), [MEK('steel_casing'), MEK('robit')]),
		event.recipes.createDeploying(MEK('steel_casing'), [MEK('steel_casing'), MEK('logistical_sorter')]),
		event.recipes.createFilling(MEK('steel_casing'), [MEK('steel_casing'), Fluid.of(MEK("brine"), 1000)]),
		event.recipes.createDeploying(MEK('steel_casing'), [MEK('steel_casing'), KJ('fake_enderman')])
	]).transitionalItem(MEK('steel_casing'))
		.loops(2)
		.id('mekanism:digital_miner')


//龙头锤爆
event.custom(
{
  "type": "farmersdelight:cutting",
  "ingredients": [
    {
      "item": "iceandfire:dragon_skull_fire"
    }
  ],
  "tool": {
    "tag": "forge:tools/wrench"
  },
  "result": [
    {
      "item": IAF('dragonbone'),
      "count": 8
    }
  ]
}
)
event.custom(
{
  "type": "farmersdelight:cutting",
  "ingredients": [
    {
      "item": "iceandfire:dragon_skull_ice"
    }
  ],
  "tool": {
    "tag": "forge:tools/wrench"
  },
  "result": [
    {
      "item": IAF('dragonbone'),
      "count": 8
    }
  ]
}
)
event.custom(
{
  "type": "farmersdelight:cutting",
  "ingredients": [
    {
      "item": "iceandfire:dragon_skull_lightning"
    }
  ],
  "tool": {
    "tag": "forge:tools/wrench"
  },
  "result": [
    {
      "item": IAF('dragonbone'),
      "count": 8
    }
  ]
}
)
//新苹果
event.shapeless('minecraft:apple', ['minecraft:ender_pearl', 'minecraft:red_dye']).id('eow:apple_dup')
//新苹果
event.custom({
  "type": "create:mixing",
  "ingredients": [
    {
      "item": "minecraft:ender_pearl",
      "count": 1
    },
    {
      "item": "minecraft:red_dye",
      "count": 1 
    }
  ],
  "results": [
    {
      "item": "minecraft:apple",
      "count": 1
    }
  ]
}).id('eow:apple_dup2')

//修改电解核心
 event.remove({id:MEK("electrolytic_core")})
 event.custom({
  "type": "create:pressing",
  "ingredients": [
    {
      "item": "crossroads:charging_stand"
    }
  ],
  "results": [
    {
      "item": "mekanism:electrolytic_core"
    }
  ]
}).id('eow:electrolytic_core')

event.remove({id:"mekanism:rotary_condensentrator"},)
event.shaped(MEK("rotary_condensentrator"), [
		'GAG',
		'CNR',
		'GAG'
	], {
		G: F('#glass'),
		A: MEK('alloy_infused'),
		C: MEK('basic_chemical_tank'),
		R: MEK('basic_fluid_tank'),
		N: MEK('energy_tablet')
	})



event.smelting('4x kubejs:os_oooo', 'minecraft:jukebox').xp(0.1).id('eow:os_oooo')
event.custom({
  "type": "create:mixing",
  "ingredients": [
    {
      "item": "kubejs:os_oooo",
      "count": 1
    },
    {
      "fluid": "mekanism:hydrogen",
      "amount": 1000
    }
  ],
  "results": [
    {
      "item": "mekanism:dust_osmium",
      "count": 1
    },
    {
      "fluid": "water",
      "amount": 500
    }
  ]
}).id('eow:dust_osmium')

})

onEvent('item.tags', event => {
	// Get the #forge:cobblestone tag collection and add Diamond Ore to it
	// event.get('forge:cobblestone').add('minecraft:diamond_ore')

	// Get the #forge:cobblestone tag collection and remove Mossy Cobblestone from it
	// event.get('forge:cobblestone').remove('minecraft:mossy_cobblestone')
})




